<%--
  Created by IntelliJ IDEA.
  User: 小文
  Date: 2021/7/1
  Time: 17:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加预约</title>
</head>
<body>
    <form action="AddServlet" method="post">
        <table border="1">
            <tr>
                <th colspan="2" align="center">添加疫苗接种预约信息</th>
            </tr>
            <tr>
                <td>预约人姓名(*)</td>
                <td><input type="text" name="userName"></td>
            </tr>
            <tr>
                <td>预约人身份证号(*)</td>
                <td><input type="text" name="cardId" id="cardId"><span></span></td>
            </tr>
            <tr>
                <td>预约接种日期(*)</td>
                <td><input type="text" name="bookingDate"></td>
            </tr>
            <tr>
                <td align="center" colspan="2"><button type="submit">提交</button></td>
            </tr>
        </table>
    </form>
    <script src="js/jquery-1.8.3.js"></script>
    <script>
        $(document).ready(function () {
            $("#cardId").blur(function () {
                var cardId = $(this).val();
                var c = $(this);
                var span = $("span");
                // alert(cardId);
                $.post("CountServlet","cardId="+cardId,function (data) {
                    span.text(data);
                    // c.focus();
                })
            })
        })
    </script>
</body>
</html>
